<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>积分规则编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
</head>
<body>
<form class="layui-form" action="" method="post" lay-filter="admin-form">
    <div class="layui-form-item">
        <div class="layui-input-inline">
            <input type="hidden" name="id" value="{$rule.id}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">规则标题</label>
        <div class="layui-input-inline">
            <input type="text" name="title" value="{$rule.title}" lay-verify="required" placeholder="请输入标题"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">绑定权限</label>
        <div class="layui-inline">
            <select name="rule_id" lay-filter="rule_id">
                <option value=""></option>
                {volist name="ruleList" id="vo"}
                <option value="{$vo.id}" {if $rule.rule_id == $vo.id}selected{/if}>{$vo.title_show}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">变动方式</label>
        <div class="layui-inline">
            <select name="change_type" lay-filter="change_type">
                <option value=""></option>
                <option value="1" {if $rule.change_type == 1}selected{/if}>增加</option>
                <option value="2" {if $rule.change_type == 2}selected{/if}>减少</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">变动数量</label>
        <div class="layui-input-inline">
            <input type="text" name="change_num" value="{$rule.change_num}" lay-verify="required" placeholder="请输入数量"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">积分类型</label>
        <div class="layui-inline">
            <select name="score_type" lay-filter="score_type">
                <option value=""></option>
                {volist name="scoreType" id="vo"}
                    <option value="{$key}" {if $rule.score_type == $key}selected{/if}>{$vo}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">频次</label>
        <div class="layui-input-inline">
            <input type="text" name="frequency" value="{$rule.frequency}" lay-verify="required" placeholder="请输入数量"
                   autocomplete="off" class="layui-input">
        </div>
        次/
        <div class="layui-inline">
            <select name="time_unit" lay-filter="time_unit">
                <option value=""></option>
                {volist name="timeUnit" id="vo"}
                    <option value="{$key}" {if $rule.time_unit == $key}selected{/if}>{$vo}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="checkbox"
                   {if isset($rule.status) && $rule.status== 1}checked{elseif !isset($rule.status)}checked{else/}{/if}
            name="status" lay-skin="switch" lay-filter="switchTest" lay-text="启用|禁用">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</form>

<script src="__LAYUI__/layui/layui.js"></script>
<script>
    layui.config({
        base: '__LAYUI__/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['index', 'form'],function() {
        var $ = layui.jquery,
            form = layui.form;
    });
</script>
</body>
</html>